<template>
  <div class="app">
    <h2>我是App组件</h2>
    <h4>我的房产：{{house}}</h4>
    <h4 v-show="wanju">儿子给的玩具：{{wanju}}</h4>
    <br>
    <Child :house="house" :getToy="getToy"/>
  </div>
</template>

<script>
  import Child from './components/Child.vue'
  export default {
    name:'App',
    components:{Child},
    data() {
      return {
        house:'大别墅',
        wanju:''
      }
    },
    methods:{
      getToy(value){
        console.log('我是父组件收到了玩具',value)
        this.wanju = value
      }
    }
  }
</script>

<style>
  .app {
    background-color: gray;
    padding: 20px;
    border-radius: 10px;
  }
</style>